/*   1:    */ package com.atomikos.icatch.jta;
/*   2:    */ 
/*   3:    */ import com.atomikos.util.SerializableObjectFactory;
/*   4:    */ import java.io.Serializable;
/*   5:    */ import javax.naming.NamingException;
/*   6:    */ import javax.naming.Reference;
/*   7:    */ import javax.naming.Referenceable;
/*   8:    */ import javax.transaction.HeuristicMixedException;
/*   9:    */ import javax.transaction.HeuristicRollbackException;
/*  10:    */ import javax.transaction.InvalidTransactionException;
/*  11:    */ import javax.transaction.NotSupportedException;
/*  12:    */ import javax.transaction.RollbackException;
/*  13:    */ import javax.transaction.SystemException;
/*  14:    */ import javax.transaction.Transaction;
/*  15:    */ import javax.transaction.TransactionManager;
/*  16:    */ import javax.transaction.UserTransaction;
/*  17:    */ 
/*  18:    */ public class J2eeTransactionManager
/*  19:    */   implements TransactionManager, Serializable, Referenceable, UserTransaction
/*  20:    */ {
/*  21:    */   private static final long serialVersionUID = 8584376600562353607L;
/*  22:    */   private transient TransactionManagerImp tm;
/*  23:    */   
/*  24:    */   private void checkSetup()
/*  25:    */     throws SystemException
/*  26:    */   {
/*  27: 65 */     this.tm = ((TransactionManagerImp)TransactionManagerImp.getTransactionManager());
/*  28: 67 */     if (this.tm == null) {
/*  29: 68 */       throw new RuntimeException("Transaction Service not running?");
/*  30:    */     }
/*  31:    */   }
/*  32:    */   
/*  33:    */   public void begin()
/*  34:    */     throws NotSupportedException, SystemException
/*  35:    */   {
/*  36: 77 */     checkSetup();
/*  37: 78 */     this.tm.begin();
/*  38:    */   }
/*  39:    */   
/*  40:    */   public void commit()
/*  41:    */     throws RollbackException, HeuristicMixedException, HeuristicRollbackException, SecurityException, IllegalStateException, SystemException
/*  42:    */   {
/*  43: 89 */     checkSetup();
/*  44: 90 */     this.tm.commit();
/*  45:    */   }
/*  46:    */   
/*  47:    */   public int getStatus()
/*  48:    */     throws SystemException
/*  49:    */   {
/*  50: 99 */     checkSetup();
/*  51:100 */     return this.tm.getStatus();
/*  52:    */   }
/*  53:    */   
/*  54:    */   public Transaction getTransaction()
/*  55:    */     throws SystemException
/*  56:    */   {
/*  57:108 */     checkSetup();
/*  58:109 */     return this.tm.getTransaction();
/*  59:    */   }
/*  60:    */   
/*  61:    */   public void resume(Transaction tx)
/*  62:    */     throws InvalidTransactionException, IllegalStateException, SystemException
/*  63:    */   {
/*  64:118 */     checkSetup();
/*  65:119 */     this.tm.resume(tx);
/*  66:    */   }
/*  67:    */   
/*  68:    */   public void rollback()
/*  69:    */     throws IllegalStateException, SecurityException, SystemException
/*  70:    */   {
/*  71:129 */     checkSetup();
/*  72:130 */     this.tm.rollback();
/*  73:    */   }
/*  74:    */   
/*  75:    */   public void setRollbackOnly()
/*  76:    */     throws IllegalStateException, SystemException
/*  77:    */   {
/*  78:140 */     checkSetup();
/*  79:141 */     this.tm.setRollbackOnly();
/*  80:    */   }
/*  81:    */   
/*  82:    */   public void setTransactionTimeout(int secs)
/*  83:    */     throws SystemException
/*  84:    */   {
/*  85:150 */     checkSetup();
/*  86:151 */     this.tm.setTransactionTimeout(secs);
/*  87:    */   }
/*  88:    */   
/*  89:    */   public Transaction suspend()
/*  90:    */     throws SystemException
/*  91:    */   {
/*  92:160 */     checkSetup();
/*  93:161 */     return this.tm.suspend();
/*  94:    */   }
/*  95:    */   
/*  96:    */   public Reference getReference()
/*  97:    */     throws NamingException
/*  98:    */   {
/*  99:166 */     return SerializableObjectFactory.createReference(this);
/* 100:    */   }
/* 101:    */ }


/* Location:           C:\myfile\mysoft\apache-maven-3.5.0-bin\apache-maven-3.5.0\myrep\com\atomikos\transactions-jta\3.7.0\transactions-jta-3.7.0.jar
 * Qualified Name:     com.atomikos.icatch.jta.J2eeTransactionManager
 * JD-Core Version:    0.7.0.1
 */